﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;
using System.Windows;
using System.Windows.Media.Effects;
using System.Windows.Media;
using System.Windows.Controls;


namespace CommomFunctions
{
    public class Titulo
    {
        private static SolidColorBrush criaCorTitulo()
        {
            //Foreground="#FFE3C1DB"
            SolidColorBrush mySolidColorBrush = new SolidColorBrush();

            mySolidColorBrush.Color = Color.FromArgb(255, 227, 193, 219);

            return mySolidColorBrush;

        }

        private static DropShadowBitmapEffect criaSombraTitulo()
        {
            
            DropShadowBitmapEffect shadow = new DropShadowBitmapEffect();
            shadow.Direction = 270;
            shadow.ShadowDepth = 3;            
            shadow.Color = Color.FromScRgb(1, 0.68f, 0.75f, 0.14f);

            return shadow;
        }

        private static BevelBitmapEffect criaBevelTitulo()
        {            
            BevelBitmapEffect bev = new BevelBitmapEffect();
            bev.BevelWidth = 5;
            bev.EdgeProfile = EdgeProfile.Linear;
            bev.Relief = 0.3;
            bev.Smoothness = 0.2;

            return bev;
        }

        private static LinearGradientBrush criaGradienteCorTitulo()
        {
            //Foreground="#FFE3C1DB"
            LinearGradientBrush myGradientBrush = new LinearGradientBrush();

            myGradientBrush.EndPoint = new Point(0.5, 1);
            myGradientBrush.StartPoint = new Point(0.5, 0);

            GradientStop gs1 = new GradientStop(Color.FromArgb(255, 243, 114, 19), 0);
            GradientStop gs2 = new GradientStop(Color.FromArgb(255, 237, 255, 16), 1);

            myGradientBrush.GradientStops.Add(gs1);
            myGradientBrush.GradientStops.Add(gs2);

            return myGradientBrush;

        }
        
        public static void setaPropriedadesTitulo(Label lblTitulo, String titulo)
        {
            lblTitulo.Visibility = Visibility.Visible;
            lblTitulo.VerticalAlignment = VerticalAlignment.Top;
            lblTitulo.HorizontalAlignment = HorizontalAlignment.Center;
            
            lblTitulo.Foreground = criaGradienteCorTitulo();
            lblTitulo.BorderBrush = Brushes.White;
            lblTitulo.HorizontalContentAlignment = HorizontalAlignment.Left;
            lblTitulo.VerticalContentAlignment = VerticalAlignment.Stretch;

            lblTitulo.FontSize = 32;
            lblTitulo.FontWeight = FontWeights.Bold;
            lblTitulo.Content = titulo;

            lblTitulo.BitmapEffect = criaBevelTitulo();
        }
    }
}
